﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using WinnerCMS.Model;

#endregion

namespace WinnerCMS.BLL.PageFactory
{
    [ToolboxData("<{0}:EliteContents runat=\"server\"></{0}:EliteContents>")]
    //[PartialCaching(10, "CategoryId;Rows", null, null)]
    public class EliteContents : DataBox
    {
        private static readonly CoreManage Bll = new CoreManage();
        private int _categoryId;

        public int CategoryId
        {
            set { this._categoryId = value; }
            get
            {
                if (this._categoryId == 0)
                {
                    this._categoryId = Convert.ToInt32(Page.RouteData.Values["CategoryId"]);
                }
                return this._categoryId;
            }
        }

        public int Rows { get; set; }


        protected override void OnLoad(EventArgs e)
        {
            DataSource = Bll.EliteContents(Rows, CategoryId);
            DataBind();
        }
    }
}